﻿namespace ipFoo.Models
{
    public class AdvancedFeatureModel
    {
        /// <summary>
        /// The ip or host to look up
        /// </summary>
        public string Lookup { get; set; }

        /// <summary>
        /// The action to perform on the ip or host
        /// </summary>
        public string Action { get; set; }

        // ReSharper disable InconsistentNaming
        // Recaptcha code stuff
        public string recaptcha_challenge_field { get; set; }
        public string recaptcha_response_field { get; set; }
        // ReSharper restore InconsistentNaming
    }

    public class AdvancedFeaturePostbackModel
    {
        private AdvancedFeatureModel _data;
        private bool _lookup = true;
        private bool _action = true;
        private bool _captcha = true;

        public AdvancedFeatureModel Data
        {
            get { return _data ?? new AdvancedFeatureModel(); }
            set { _data = value; }
        }

        public string ExecutionResults { get; set; }
        public bool ValidLookup { get { return _lookup; } set { _lookup = value; } }
        public bool ValidAction { get { return _action; } set { _action = value; } }
        public bool ValidCaptcha { get { return _captcha; } set { _captcha = value; } }
        public bool IsValid { get { return _lookup && _action && _captcha; } }
    }
}